<?php
########################################################
# DMS Donations Management System v1.0                 #
# created by:  Isaac Sabas                             #
#			   Nikko Reyes							   #
#			   Miko Tiamwatt						   #
#                                                      #
# De La Salle Philippines                              #
# All Rights Reserved DLSP Copyright 2009              #
########################################################

define('START', true);	

session_start();	
	
#############################	
# set error checking levels #
#############################			
	# enable these lines when site is to be deployed #	
	ini_set('error_reporting', E_ALL);
    ini_set('display_errors', 'On');
    //ini_set('log_errors', 'On');
    //ini_set('error_log', '/usr/local/apache/logs/error_log');
	
#############################
# include some needed files #
#############################
	# include some needed files #
	$absRoot = '../../';
	include($absRoot . 'lib/PEAR/PEAR/Sigma.php');	
	include($absRoot . 'lib/XAJAX/xajax_core/xajax.inc.php');	
	
##################################	
# instantiate predifined classes #
##################################
	$template = new HTML_Template_Sigma($absRoot . 'templates', 'templates-cache');												
	//$xajax = new xajax();				
	
###########################################################	
# register all functions to be handled by XAJAX framework #
###########################################################
	/*function echo_ajaxtest($text) {
		$objResponse = new xajaxResponse();
					
		$objResponse->addAssign("_ajaxtest.response","innerHTML", $text);				
		
		return $objResponse;
	}

	$xajax->registerFunction("echo_ajaxtest");
	*/
##################
# page variables #
##################	
	$page_title = 'De La Salle University | Donations Management System ';
	$css = $absRoot . 'css/index.css';
	//$xajax_directives = $xajax->getJavascriptConfig() . $xajax->getJavascriptInclude('lib/XAJAX/');										

###########################
# load template to buffer #
###########################
	$template->loadTemplateFile('contents/telemarketerList.html');	

#########################################
# index page template processor section #
#########################################																							
	
########################	
# login logout section #		
########################

############################			
# privelage filter section #
############################

	#########################					
	# page processor engine #			
	#########################
	
##########################	
# set template variables #
##########################	
	$template->setVariable('PAGE_TITLE', $page_title);	
	$template->setVariable('STYLE', $css);
	$template->setVariable('absRoot', $absRoot);
	//$template->setVariable('XAJAX_INIT', $xajax_directives);
	
	/*
	$client_item_counter = 6;
	$client_item_printer = false;
	$page_counter = 1;
	
	$template->addBlockFile('DASHBOARD_CLIENT_PANEL_PAGE', 'DASHBOARD_CLIENT_PANEL_PAGE', 'dashboard_client_panel.tpl');
	
	while (!$client_item_printer) {								
						
			$template->setVariable('CLIENT_PANEL_PAGE', 'page' . ($page_counter));
			$x = 0;			
			while ($x<5 && !$client_item_printer) {		
				if ($client_item_counter != 0) {
					$template->setVariable('CLIENT_ID', $x);	
					$template->setVariable('CLIENT_NAME', 'Isaac Herculano Sun Sabas');
					$template->parse('dashboard_client_item');	
					$x++;
					$client_item_counter--;				
				}
				else {
					$client_item_printer = true;
				}	
			}		
			$page_counter++;
			$template->parse('DASHBOARD_CLIENT_PANEL_PAGE');				
	}
	*/
	
	$template->setVariable('CALL_PURPOSE', '1');
	$template->setVariable('CLIENT_ID', '0');	
	$template->setVariable('CLIENT_NAME', 'Pogz Ortile');
	$template->setVariable('CLIENT_CALL_STATUS', 'Pickup Reminder');
	$template->setVariable('TICKET_ID', '1');
	$template->parse('dashboard_client_item');
	
	for ($i=1;$i<9;$i++) {
		$template->setVariable('CALL_PURPOSE', '2');
		$template->setVariable('CLIENT_ID', $i);
		$template->setVariable('TICKET_ID', 'null');	
		$template->setVariable('CLIENT_NAME', 'Isaac Herculano Sun Sabas');
		$template->setVariable('CLIENT_CALL_STATUS', 'For Follow-up');
		$template->parse('dashboard_client_item');	
	}
	
	
#############################	
# render the index template #
#############################
	//$xajax->processRequests();	
	$template->show();		
?>
